package main

import (
	"context"
	"fmt"
	"go_keep_learning/grpc/micro/pb"

	"google.golang.org/grpc"
)

func main() {

	// 链接服务
	grpcConn, _ := grpc.Dial(":8800", grpc.WithInsecure())

	//初始化 grpc 客户端
	grpcClient := pb.NewGreeterClient(grpcConn)
	//调用远程函数

	resp, err := grpcClient.SayHello(context.TODO(), &pb.HelloReq{Name: "wc"})
	if err != nil {
		fmt.Println(nil)
		return
	}

	fmt.Println(resp)
	resp2, err := grpcClient.SayHello(context.TODO(), &pb.HelloReq{Name: "wc"})
   fmt.Println(resp2)
}
